import java.sql.SQLOutput;
import java.util.Scanner;

public class test {
    public static void main1(String[] args){
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int cnt = 0;
        for(int i = 1;i <= n;i++) {
            int val = i;
            while(val > 0) {
                if(val % 10 == 9) {
                    cnt++;
                    break;
                }
                val /= 10;
            }
        }
        System.out.println(cnt);
    }

    public static void main2(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        boolean flag = true;
        for (int i = 2; i < n; i++) {
               if(n % i == 0) {
                   System.out.println("不是素数");
                   flag = false;
                   break;
               }
        }
        if(flag == true) System.out.println("是素数");
    }

    public static void main3(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int a = scanner.nextInt();
        int b = scanner.nextInt();
        int c = 1;
        while (c != 0) {
            c = a % b;
            a = b;
            b = c;
        }
        System.out.println(a);
    }

    public static void main4(String[] args) {
        for(int i = 1000;i <= 2000;i++){
            if((i % 4 == 0 && i % 100 != 0) || (i % 400 == 0)){
                System.out.println(i);
            }
        }
    }

    public static void main5(String[] args) {
        int flag = 1;
        double sum = 0;
        for(int i = 1;i <= 100;i++){
            sum += 1.0/i * flag;
            flag = -flag;
        }
        System.out.println(sum);
    }

    public static void main6(String[] args) {
        Scanner in = new Scanner(System.in);
        int count = 3;
        while(count != 0){
            System.out.println("请输入密码" + count + "次机会");
            String s = in.nextLine();// 每次都需要输入
            if(s.equals("1234")){
                System.out.println("密码正确");
                break;
            }
            else{
                System.out.println("密码错误");
                count--;
            }
        }
    }

    public static void main7(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        for(int i = 1;i <= n;i++){
            for(int j = 1;j <= i;j++){
                System.out.print("\t"+j + "*" + i + "=" + i * j);
                System.out.print(" ");
            }
            System.out.println();
        }
    }

    public static void main(String[] args) {
        int n = 7;
        for(int i = 31;i >= 0;i -= 2){
            System.out.print(((n >>> i) & 1)+ " ");
        }
        // 0 ~ 31
        System.out.println();
        for(int i = 30;i >= 0;i -= 2){
            System.out.print(((n >>> i)&1) + " ");
        }
    }
}
